package edu.mtu.citizenscience.cs.utils;

import android.content.Context;
import android.util.TypedValue;
/**
 * @author Corbin Uselton <corbinu@cwuselto@mtu.edu>
 * @copyright (c) 2012 MichiganTech <http://www.mtu.edu>
 * @since 1.0
 * 
 * Holds utilities for making conversion
 */
public class Convert {

	/**
	 * Converts dp to px
	 * Useful for scaling photos
	 * 
	 * @param   context - Context - The activity doing the conversion
	 * @param	int - dp - The dp value to convert to px
	 * @return	int - the px value
	 */
	public static int dpToPX(Context context, int dp)
	{
		return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics()));
	}

}
